{{ define "main" }}
    {{ partial "header" . }}

    <div class="content">
        <div class="container">
            <div class="row justify-content-center">
                <div class="col-sm-12 col-lg-8">
                    <h1 class="mx-0 mx-md-4 blog-post-title">{{ .Title }}</h1>

                    <div class="mb-md-4 meta">
                        {{ if not .Params.noauthor }}
                            {{ if .Params.author }}
                                <span class="author" title="{{ .Params.Author }}">
                                    {{ .Params.author }}
                                </span>
                            {{ end }}
                        {{ end }}

                        <span class="date middot" title='{{ .Date.Format "Mon Jan 2 2006 15:04:05 MST" }}'>
                            {{ .Date.Format  "2006-01-02" }}
                        </span>

                        <span class="reading-time middot">
                            {{ .ReadingTime }} min read
                        </span>

                        <div class="d-none d-md-inline tags">
                            <ul class="list-unstyled d-inline">
                                {{ range .Params.tags }}
                                    <li class="d-inline middot">
                                        <a href="{{ "/tags/" | relLangURL }}{{ . | urlize }}">{{ . }}</a>
                                    </li>
                                {{ end }}
                            </ul>
                        </div>

                        <div class="d-none d-md-inline tags">
                            <ul class="list-unstyled d-inline">
                                {{ if isset .Params "hacker_news_id" }}
                                    {{ if ne .Params.hacker_news_id "" }}
                                        <li class="d-inline middot">
                                            <a href="https://news.ycombinator.com/item?id={{ .Params.hacker_news_id }}">Hacker News</a>
                                        </li>
                                    {{ end }}
                                {{ end }}
                                {{ if isset .Params "lobsters_id" }}
                                    {{ if ne .Params.lobsters_id "" }}
                                        <li class="d-inline middot">
                                            <a href="https://lobste.rs/s/{{ .Params.lobsters_id }}">Lobsters</a>
                                        </li>
                                    {{ end }}
                                {{ end }}
                            </ul>
                        </div>
                    </div>

                    <div class="markdown blog-post-content">
                        {{ partial "content" . }}
                    </div>

                    {{ if .Site.Params.posts_navigation }}
                        <div class="navigation">
                            <div class="row">
                                <div class="col-12 col-lg-6">
                                    {{ if .PrevInSection }}
                                        <div class="mx-0 mx-md-4 mt-4 text-left">
                                            <a href="{{ .PrevInSection.Permalink }}">« {{ .PrevInSection.Title }}</a>
                                        </div>
                                    {{ end }}
                                </div>
                                <div class="col-12 col-lg-6">
                                    {{ if .NextInSection }}
                                        <div class="mx-0 mx-md-4 mt-4 text-right">
                                            <a href="{{ .NextInSection.Permalink }}">{{ .NextInSection.Title }} »</a>
                                        </div>
                                    {{ end }}
                                </div>
                            </div>
                        </div>
                    {{ end }}
                </div>
            </div>
        </div>
    </div>

    {{ partial "utterances.html" .}}
    {{ partial "footer" . }}
{{ end }}
